<<<<<<< HEAD
"""
拟合观测数据
"""

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit

data = pd.read_csv('data/data.csv', sep=',').drop(['ID'], axis=1)
y0, x1, x2, x3 = data.iloc[:, 0].values, data.iloc[:, 1].values, data.iloc[:, 2].values, data.iloc[:, 3].values

def fun(X, k1, k2):
    x1, x2, x3 = X
    return np.exp(-k1*x1) * np.sin(k2*x2) + np.power(x3, 2)

popt, _ = curve_fit(fun, (x1, x2, x3), y0, bounds=(0, [20, 2]))
k1, k2 = popt
=======
"""
拟合观测数据
"""

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit

data = pd.read_csv('data/data.csv', sep=',').drop(['ID'], axis=1)
y0, x1, x2, x3 = data.iloc[:, 0].values, data.iloc[:, 1].values, data.iloc[:, 2].values, data.iloc[:, 3].values

def fun(X, k1, k2):
    x1, x2, x3 = X
    return np.exp(-k1*x1) * np.sin(k2*x2) + np.power(x3, 2)

popt, _ = curve_fit(fun, (x1, x2, x3), y0, bounds=(0, [20, 2]))
k1, k2 = popt
>>>>>>> a66c8eec2c3bbe955d7da215f43ffffda9c7b6b5
y1 = fun((x1, x2, x3), k1, k2)